package com.soxing.braindata.service.manager;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.soxing.braindata.dao.domain.request.ExperimentSearchRequest;
import com.soxing.braindata.dao.domain.request.SearchRequest;
import com.soxing.braindata.dao.domain.request.TesteeExperimentFileSearchRequest;
import com.soxing.braindata.dao.entity.Equipment;
import com.soxing.braindata.dao.entity.Experiment;
import com.soxing.braindata.dao.entity.TesteeExperiment;
import com.soxing.braindata.dao.entity.TesteeExperimentFile;
import com.soxing.braindata.dao.service.ITesteeExperimentFileService;
import com.soxing.braindata.dao.service.impl.TesteeExperimentFileServiceImpl;
import com.soxing.braindata.domain.request.EquipmentSearchRequest;
import com.soxing.common.utils.util.ObjectMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class TesteeExperimentFileManagerImpl extends AbstractManager<TesteeExperimentFile> implements ITesteeExperimentFileManager{

    @Resource
    private ITesteeExperimentFileService testeeExperimentFileService;

    @Override
    public IService<TesteeExperimentFile> getService() {
        return testeeExperimentFileService;
    }

    @Override
    public LambdaQueryWrapper<TesteeExperimentFile> wrapSearchRequest(SearchRequest request) {
        TesteeExperimentFileSearchRequest searchRequest = (TesteeExperimentFileSearchRequest) request;
        if (request == null) {
            searchRequest = new TesteeExperimentFileSearchRequest();
        }
        TesteeExperimentFile obj = ObjectMapper.map(searchRequest, TesteeExperimentFile.class);
        LambdaQueryWrapper<TesteeExperimentFile> queryWrapper = new LambdaQueryWrapper<>(obj);
        return queryWrapper;
        
    }
}
